package com.iwhalecloud.bss.kite.cucc.web.controller.order;

import com.iwhalecloud.bss.kite.client.dto.DataResult;
import com.iwhalecloud.bss.kite.common.constant.ErrorConsts;
import com.iwhalecloud.bss.kite.cucc.client.api.inf.IInfServiceBus;
import com.iwhalecloud.bss.kite.cucc.client.dto.scene.discount.HistoryPriceData;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName : DiscountApplicationController
 * @Description :
 * @Author : xie.zhengjun
 * @Date : 2020/9/14 17:02
 */
@RestController
@RequestMapping("/discountApproval")
@Api(tags = {"/discountApproval - 折扣审批"
})
public class DiscountApprovalController {

    @Resource
    private IInfServiceBus infServiceBus;

//    @ApiOperation(value = "新增OOP折扣审批", notes = "新增OOP折扣审批")
//    @ApiImplicitParams({@ApiImplicitParam(name = "busiMap", value = "入参", required = true, type = "map")
//    })
//    @PostMapping
//    public DataResult<Map> addOopDiscountApproval(@RequestBody Map<String, String> busiMap) {
//        return discountApprovalService.addOopDiscountApproval(busiMap);
//    }

    @ApiOperation(value = "历史价格查询", notes = "历史价格查询")
    @ApiImplicitParams({@ApiImplicitParam(name = "productId", value = "产品编码", required = true),
        @ApiImplicitParam(name = "custName", value = "客户名称", required = true),
        @ApiImplicitParam(name = "servId", value = "业务号码"),
        @ApiImplicitParam(name = "page", value = "历史价格页码", required = true),
        @ApiImplicitParam(name = "size", value = "历史价格数量", required = true)
    })
    @GetMapping("/historyPriceData")
    public DataResult<List<HistoryPriceData>> listHistoryPriceData(@RequestParam String productId,
        @RequestParam String custName, @RequestParam(required = false) String servId, @RequestParam Integer page,
        @RequestParam Integer size) {
        return ErrorConsts.SUCCESS
            .getResult(infServiceBus.listHistoryPriceData(productId, custName, servId, page, size));
    }
}
